package com.lazyben.provider.controller;

import com.lazyben.model.Message;
import com.lazyben.server.MessageContainer;
import com.lazyben.server.PushServer;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/message")
public class MsgController {
    @PostMapping
    public void sendMessage(@RequestBody Message message) {
        message.setMessageType(Message.MessageType.MSG);
        MessageContainer.add(message);
//        PushServer.send(message);
    }
}
